
load('summary_data/figA3.rda')

g1 = ggplot(out1, aes(x = income_est, group = income_est)) +
  geom_boxplot(aes(ymin = `5%`, ymax = `95%`, middle = `50%`, lower = `25%`, upper = `75%`),
               stat = 'identity') +
  theme_bw() +
  labs(x = 'Estimated Income Bin (L2)', y = 'Total Assessed Property Value\n(CoreLogic agg.)') +
  scale_x_discrete(labels = paste0('$', as.numeric(sort(unique(out1$income_est))), 'k')) +
  scale_y_continuous(labels = scales::label_dollar(suffix = 'k', scale = 0.001))

g2 = ggplot(out2, aes(x = net_worth, group = net_worth)) +
  geom_boxplot(aes(ymin = `5%`, ymax = `95%`, middle = `50%`, lower = `25%`, upper = `75%`), stat = 'identity') +
  theme_bw() +
  labs(x = 'Estimated Net Worth Bin (L2)', y = 'Total Assessed Property Value\n(CoreLogic agg.)') +
  scale_x_discrete(labels = paste0('$', as.numeric(sort(unique(out2$net_worth))), 'k')) +
  scale_y_continuous(labels = scales::label_dollar(suffix = 'k', scale = 0.001))

plot = plot_grid(g1, g2)

ggsave(filename = 'figures/figA3.pdf', plot = plot, width = 11, height = 4)
